<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style type="text/css">
        #outer {
            text-align: center;
        }
        
        .f-text {
            width: 50px;
            margin: 0 5px;
        }
        
        strong,
        span {
            padding: 0 5px;
        }
        
        span {
            color: red;
        }
    </style>

</head>

<body>
    <div id="outer">
        <input type="text" class="f-text"><strong>vs</strong><input type="text" class="f-text"><input type="button" value="最大的数是>>"><span>?</span>
    </div>

</body>

</html>
<script>
    var fds = document.getElementsByTagName("input");
    var axp = document.getElementsByTagName("span")[0];
    for (var i = 0; i < fds.length - 1; i++) {
        fds[i].onkeyup = function() {
            this.value = this.value.replace(/[^\d]/, "")
        }

        function match() {
            var m = 0;
            m = parseInt(fds[0].value) >= parseInt(fds[1].value) ? parseInt(fds[0].value) : parseInt(oInput[1].value)
            return m;
        }
        fds[2].onclick = function() {
            axp.innerHTML = match();
        }
    }
</script>